home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / PredatorPrey / PredatorPrey.h < prev    next >
Encoding:
Text File  |  1996-06-22  |  24.5 KB  |  803 lines  |  [TEXT/KAHL]

  1.  /*    PredatorPrey.h    */
  2. //#define    testPrey
  3.  
  4. #ifndef __C14__
  5. #define __C14__
  6.  
  7. #ifdef _DECLAIR
  8.     #define EXTERN 
  9. #else
  10.     #define EXTERN extern
  11. #endif
  12.  
  13. #define    quiet
  14. #define runfast                TRUE
  15. #define fast                TRUE
  16. #define    DEBUGGING            TRUE
  17. #define    debugPers            FALSE
  18. //#define    debugPers            TRUE
  19.  
  20. //#include <SANE.h>
  21. //#include <math.h>
  22. #include <fp.h>
  23. #include <stdlib.h>
  24. #include <stdio.h>
  25.  
  26. /*#ifndef    __H_Lists*/
  27. /*#define    __H_Lists*/
  28.  
  29. /*#include <Lists.h>*/
  30.  
  31. /*#endif*/
  32.  
  33. /*    #include <FileMgr.h>    */
  34. #include <StandardFile.h>
  35. #include <errno.h>
  36. #include <Printing.h>
  37. #include <Windows.h>
  38. #include <Sound.h>
  39. #include "calc_wizard.h"
  40. /*#include "PredatorPreyData.h"*/
  41. /*#include "AEvent.h"*/
  42.                                     /*    progLimit used in SearchLabel and nowhere else    */
  43. #define progLimit            448        /*    magic number, maximum number of program steps    */
  44. #define NIL                 0L        /*  could also be written  "0x00000000"        */
  45. #define    NIL_STRING            "\p"
  46. #define    windMax                16
  47.  
  48. #define H_RPAGE_DEFAULT         640
  49. #define V_RPAGE_DEFAULT         752
  50.  
  51. #define UNIMPLEMENTED                0xA89F    /* A-trap code for unimplemented function    */
  52. #define    BASE_RES_ID                    400
  53.  
  54. #define    FILE_OPEN                        415
  55. #define    NO_FILE                            416
  56. #define    SPLASH_SCREEN                415
  57. #define    SHR_SCRN                        416
  58. #define    WIZ_SCRN                        417
  59. #define    PASS_SCRN                        418
  60. #define    PASS_SCRN2                    432
  61. #define    NOT_GRAPHICS_WINDOW    419
  62. #define    NO_STRETCH_DIALOG        420
  63. #define    NO_ROTATE_DIALOG        425
  64. #define    NO_ROTATION_BOX            426
  65. #define    NO_STRETCH_BOX            427
  66. #define    UNDER_CONSTRUCTION            428
  67. #define    NOT_A_WIZARD                430
  68. #define    COPY_REG_NO                    431
  69. #define    NO_SOLVE_YET                432
  70. #define    NO_MATRIX_INVERSION            433
  71. #define    NO_INTEGRATION                434
  72. #define GET_SOLVE_DATA                435
  73. #define MAT_DIV_UNDEF                436
  74. #define NOT_SQUARE                    437
  75.  
  76.  
  77. #define    WRITE_ERR                        256
  78. #define    CREATE_ERR                    257
  79. #define    OPEN_ERR                        258
  80. #define    READ_ERR                        259
  81. #define    SAVE_CHANGES                260
  82.  
  83. #define    SUCCESS                            0            /*  save_file() return codes                */
  84. #define    CANCELED                        1
  85. #define    FILE_ERROR                    -1
  86.  
  87. #define    CREATOR_CODE                'INRS'
  88. #define    TYPE_CODE                        'INRG'
  89.  
  90. #define    SAVE_YES                        1
  91. #define    SAVE_CANCEL                    2
  92. #define    SAVE_NO                            3
  93.  
  94. #define    DO_SAVE                            1
  95. #define    DO_SFPUT                        2
  96.  
  97. #define    SAVE_ID                            9001
  98. #define    AS_ID                                9002
  99.  
  100. /*    ICON resources ID nos.    */    
  101.  
  102. #define    L_SNOOPY_ID                    128
  103. #define    R_SNOOPY_ID                    129
  104. #define    FIRST_CALC_ID                130
  105. #define    SECOND_CALC_ID            131
  106. #define    THIRD_CALC_ID                132
  107. #define    FOURTH_CALC_ID            133
  108. #define    FIFTH_CALC_ID                134
  109. #define    SIXTH_CALC_ID                135
  110.  
  111. #define    ARROW_ID                        2001
  112. #define    CIRCLE_ID                        2002
  113. #define    SQUARE_ID                        2003
  114. #define    CUBE_ID                            2004
  115. #define    HOUSE_ID                        2005
  116. #define    BACKGRND_ID                    2006
  117. #define    GUNS_ID                            2007
  118. #define    MISSLES_ID                    2008
  119. #define    N_BOMB_ID                        2009
  120. #define    ZERO_ID                            2010
  121. #define    ONE_ID                            2011
  122. #define    TWO_ID                            2012
  123. #define    THREE_ID                        2013
  124. #define    FOUR_ID                            2014
  125. #define    FIVE_ID                            2015
  126. #define    SIX_ID                            2016
  127.  
  128. #define    ROT_X_ID                        3001
  129. #define    ROT_X_ID_DOWN                3011
  130. #define    ROT_Y_ID                        3002
  131. #define    ROT_Y_ID_DOWN                3012
  132. #define    ROT_Z_ID                        3003
  133. #define    ROT_Z_ID_DOWN                3013
  134.  
  135. #define    NEG_ROT_X_ID                3101
  136. #define    NEG_ROT_X_ID_DN            3111
  137. #define    NEG_ROT_Y_ID                3102
  138. #define    NEG_ROT_Y_ID_DN            3112
  139. #define    NEG_ROT_Z_ID                3103
  140. #define    NEG_ROT_Z_ID_DN            3113
  141. #define    DO_MANY_ROT_BOX_ID    3200
  142. #define    DO_MANY_ROT_BOX_ID_DN    3201
  143.  
  144. #define    STR_X_ID                        4001
  145. #define    STR_X_ID_DOWN                4011
  146. #define    STR_Y_ID                        4002
  147. #define    STR_Y_ID_DOWN                4012
  148. #define    STR_Z_ID                        4003
  149. #define    STR_Z_ID_DOWN                4013
  150.  
  151. #define    NEG_STR_X_ID                4101
  152. #define    NEG_STR_X_ID_DN            4111
  153. #define    NEG_STR_Y_ID                4102
  154. #define    NEG_STR_Y_ID_DN            4112
  155. #define    NEG_STR_Z_ID                4103
  156. #define    NEG_STR_Z_ID_DN            4113
  157.  
  158. #define    ROT_LEFT_ID                    5001
  159. #define    ROT_LEFT_ID_DN            5011
  160. #define    ROT_RT_ID                        5002
  161. #define    ROT_RT_ID_DN                5012
  162. #define    ROT_UP_ID                        5003
  163. #define    ROT_UP_ID_DN                5013
  164. #define    ROT_DN_ID                        5004
  165. #define    ROT_DN_ID_DN                5014
  166. #define    MOVE_IN_ID                    5005
  167. #define    MOVE_IN_ID_DN                5015
  168. #define    MOVE_OUT_ID                    5006
  169. #define    MOVE_OUT_ID_DN            5016
  170. #define    PITCH_UP_ID                    5100
  171. #define    PITCH_UP_ID_DN            5110
  172. #define    PITCH_DN_ID                    5101
  173. #define    PITCH_DN_ID_DN            5111
  174. #define    YAW_LFT_ID                    5102
  175. #define    YAW_LFT_ID_DN                5112
  176. #define    YAW_RT_ID                        5103
  177. #define    YAW_RT_ID_DN                5113
  178. #define    BANK_LFT_ID                    5104
  179. #define    BANK_LFT_ID_DN            5114
  180. #define    BANK_RT_ID                    5105
  181. #define    BANK_RT_ID_DN                5115
  182.  
  183. #define    NIL_POINTER                    0L
  184. #define    NIL_PTR                            0L
  185.  
  186. #define    MOVE_TO_FRONT                -1L
  187. #define    REMOVE_ALL_EVENTS        0
  188.  
  189. #define    HORIZONTAL_PIXEL        64
  190. #define    VERTICAL_PIXEL            42/*47*/
  191. #define    NHORIZONTAL_PIXEL        HORIZONTAL_PIXEL
  192. #define    NVERTICAL_PIXEL            VERTICAL_PIXEL - 22
  193. #define    H_PIX                                HORIZONTAL_PIXEL
  194. #define    NH_PIX                            HORIZONTAL_PIXEL
  195. #define    V_PIX                                VERTICAL_PIXEL
  196. #define    NV_PIX                            VERTICAL_PIXEL - 22
  197.  
  198. #define    SCROLLBAR_ID                1000
  199.  
  200. #define    SCROLL_UP                        -1
  201. #define    SCROLL_DOWN                    1
  202.  
  203.  
  204. #define    SLEEP                                0L
  205. #define    NIL_MOUSE_REGION        0L
  206. #define    WNE_TRAP_NUM                0x60
  207. #define    UNIMPL_TRAP_NUM            0x9F
  208. #define    SUSPEND_RESUME_BIT    0x0001
  209.  
  210. /*    menu & menu_item ID's    */
  211.  
  212. #define    APPLE_MENU_ID                BASE_RES_ID        /*    400    */
  213. #define    FILE_MENU_ID                BASE_RES_ID+1
  214. #define    EDIT_MENU_ID                BASE_RES_ID+2
  215. #define    GRAPHICS_MENU_ID            BASE_RES_ID+5
  216. #define    DORK_MENU_ID                BASE_RES_ID+6
  217. //#define    PLOT_MENU_ID                BASE_RES_ID+7
  218. #define    GRAPHICS_SUBMENU_ID    100
  219.  
  220. #define    ABOUT_ITEM_ID                1
  221. #define    HELP_ITEM                    2
  222. #define    ALT_HELP_ITEM                3
  223. #define    OPEN_DATA_FILE_ITEM            1
  224. #define    SAVE_DATA_FILE_ITEM            2
  225. #define    CLOSE_ITEM                    3
  226. #define    QUIT_ITEM                    4
  227. #define    NEW_GRAPHICS_WINDOW            1
  228. #define    OPEN_GRAPHICS_WINDOW        1
  229. #define    ROTATION_BOX                1
  230. #define    STRETCH_BOX                    2
  231. /*#define    ROTATE_CUBE                    4*/
  232. /*#define    STRETCH_CUBE                5*/
  233.  
  234.  
  235. #define    BTN_TOP                            95
  236. #define    BTN_LFT                            29
  237. #define    NBTN_TOP                        52
  238. #define    NBTN_LFT                        6
  239.  
  240. #define    ON                                    1
  241. #define    OFF                                    0
  242.  
  243. //#define    TRUE                            1
  244. //#define    FALSE                            0
  245. #define    ONE_BUTTON                    1
  246. #define    TWO_BUTTON                    2
  247. #define    THREE_BUTTON                3
  248. #define    FOUR_BUTTON                    4
  249. #define    FIVE_BUTTON                    5
  250. #define    SIX_BUTTON                    6
  251. #define    SEVEN_BUTTON                7
  252. #define    EIGHT_BUTTON                8
  253. #define    NINE_BUTTON                    9
  254. #define    ZERO_BUTTON                    10
  255. #define    PLUS_BUTTON                    11
  256. #define    MINUS_BUTTON                12
  257. #define    TIMES_BUTTON                13
  258. #define    DIVIDE_BUTTON                14
  259. #define    RCL_BUTTON                    15
  260. #define    ENTER_BUTTON                16
  261. #define    DECIMAL_BUTTON                17    
  262. #define    ERASE_BUTTON                18        
  263. #define    SUM_BUTTON                    19
  264. #define    TENTOX_BUTTON                20
  265. #define    ETOX_BUTTON                    21
  266. #define    YTOX_BUTTON                    22
  267. #define    INVERSE_BUTTON                23
  268. #define    SIN_BUTTON                    24
  269. #define    COS_BUTTON                    25
  270. #define    TAN_BUTTON                    26
  271. #define    GTO_BUTTON                    27
  272. #define    GSB_BUTTON                    28
  273. #define    ROLLDN_BUTTON                29
  274. #define    EEX_BUTTON                    30
  275. #define    SST_BUTTON                    31
  276. #define    RUNSTOP_BUTTON                32
  277. #define    FFXN_BUTTON                    33
  278. #define    GFXN_BUTTON                    34
  279. #define    ON_BUTTON                    35
  280. #define    STO_BUTTON                    36
  281. #define    EXCHXY_BUTTON                37
  282. #define    CHS_BUTTON                    38
  283. #define    SQRT_BUTTON                    39
  284.  
  285. #define    MT                            0x00    /*    0x00;    /*    MT                    */    /*    00    */
  286. #define    SQRT_CODE                    0x0B    /*    0x0B;    /*    SQRT_CODE            */    /*    11    */
  287. #define    ETOX_CODE                    0x0C    /*    0x0C;    /*    ETOX_CODE            */    /*    12    */
  288. #define    TENTOX_CODE                    0x0D    /*    0x0D;    /*    TENTOX_CODE            */    /*    13    */
  289. #define    YTOX_CODE                    0x0E    /*    0x0E;    /*    YTOX_CODE            */    /*    14    */
  290. #define    INVERSE_CODE                0x0F    /*    0x0F;    /*    INVERSE_CODE        */    /*    15    */
  291. #define    CHS_CODE                    0x10    /*    0x10;    /*    CHS_CODE            */    /*    16    */
  292. #define    SEVEN_CODE                    0x11    /*    0x11;    /*    SEVEN_CODE            */    /*    17    */
  293. #define    EIGHT_CODE                    0x12    /*    0x12;    /*    EIGHT_CODE            */    /*    18    */
  294. #define    NINE_CODE                    0x13    /*    0x13;    /*    NINE_CODE            */    /*    19    */
  295. #define    DIVIDE_CODE                    0x0A    /*    0x0A;    /*    DIVIDE_CODE            */    /*    10    */
  296.  
  297. #define    SST_CODE            0x15    /*    0x15;    /*    SST_CODE        */    /*    21    */
  298. #define    GTO_CODE            0x16    /*    0x16;    /*    GTO_CODE        */    /*    22    */
  299. #define    SIN_CODE            0x17    /*    0x17;    /*    SIN_CODE        */    /*    23    */
  300. #define    COS_CODE            0x18    /*    0x18;    /*    COS_CODE        */    /*    24    */
  301. #define    TAN_CODE            0x19    /*    0x19;    /*    TAN_CODE        */    /*    25    */
  302. #define    EEX_CODE            0x1A    /*    0x1A;    /*    EEX_CODE        */    /*    26    */
  303. #define    FOUR_CODE            0x1B    /*    0x1B;    /*    FOUR_CODE        */    /*    27    */
  304. #define    FIVE_CODE            0x1C    /*    0x1C;    /*    FIVE_CODE        */    /*    28    */
  305. #define    SIX_CODE            0x1D    /*    0x1D;    /*    SIX_CODE        */    /*    29    */
  306. #define    TIMES_CODE            0x14    /*    0x14;    /*    TIMES_CODE        */    /*    20    */
  307.  
  308. #define    RUNSTOP_CODE        0x1F    /*    0x1F;    /*    RUNSTOP_CODE    */    /*    31    */
  309. #define    GSB_CODE            0x20    /*    0x20;    /*    GSB_CODE        */    /*    32    */
  310. #define    ROLLDN_CODE            0x21    /*    0x21;    /*    ROLLDN_CODE        */    /*    33    */
  311. #define    EXCHXY_CODE            0x22    /*    0x22;    /*    EXCHXY_CODE        */    /*    34    */
  312. #define    ERASE_CODE            0x23    /*    0x23;    /*    ERASE_CODE        */    /*    35    */
  313. #define    ENTER_CODE            0x24    /*    0x24;    /*    ENTER_CODE        */    /*    36    */
  314. #define    ONE_CODE            0x25    /*    0x25;    /*    ONE_CODE        */    /*    37    */
  315. #define    TWO_CODE            0x26    /*    0x26;    /*    TWO_CODE        */    /*    38    */
  316. #define    THREE_CODE            0x27    /*    0x27;    /*    THREE_CODE        */    /*    39    */
  317. #define    MINUS_CODE            0x1E    /*    0x1E;    /*    MINUS_CODE        */    /*    30    */
  318.  
  319. #define    ON_CODE                0x29    /*    0x29;    /*    ON_CODE            */    /*    41    */
  320. #define    FFXN_CODE            0x2A    /*    0x2A;    /*    FFXN_CODE        */    /*    42    */
  321. #define    GFXN_CODE            0x2B    /*    0x2B;    /*    GFXN_CODE        */    /*    43    */
  322. #define    STO_CODE            0x2C    /*    0x2C;    /*    STO_CODE        */    /*    44    */
  323. #define    RCL_CODE            0x2D    /*    0x2D;    /*    RCL_CODE        */    /*    45    */
  324. #define    ZERO_CODE            0x2F    /*    0x2F;    /*    ZERO_CODE        */    /*    47    */
  325. #define    DECIMAL_CODE        0x30    /*    0x30;    /*    DECIMAL_CODE    */    /*    48    */
  326. #define    SUM_CODE            0x31    /*    0x31;    /*    SUM_CODE        */    /*    49    */
  327. #define    PLUS_CODE            0x28    /*    0x28;    /*    PLUS_CODE        */    /*    40    */
  328.  
  329.  
  330.  
  331.  
  332. #define    SYS_VERSION            1
  333. #define    TEXT_FONT_SIZE        9
  334. #define    NO_PICTURE            BASE_RES_ID+2
  335.  
  336. #define    DRAG_THRESHOLD        30
  337. #define    MIN_WINDOW_HEIGHT    50
  338. #define    MIN_WINDOW_WIDTH    50
  339. #define    SCROLL_BAR_PIXELS    16
  340.  
  341. //#define    ours(w)    ((gCalcWindow != NULL) && (w == gCalcWindow)) || ((gNewCalcWindow != NULL) && (w == gNewCalcWindow)) || ((gIconizeWindow != NULL) && (w == gIconizeWindow))
  342.  
  343. #define        windMax                16
  344. #define        windTEHMax            12
  345. #define        windCntlHMax        8
  346.  
  347.  
  348. /******************            Windows and Contents                ******************/
  349.  
  350. #define        WINDOW_ID            2000
  351. #define        ROTATION_BOX_ID        2001
  352. #define        STRETCH_BOX_ID        2002
  353. #define        W_TITLE_ID            1000
  354. #define        P_TITLE_ID            1001
  355.  
  356.  
  357. #define        MY_WINDOW_MAX        5
  358.  
  359. #define        OBJECT_SIZE            25
  360. #define        HSE_OBJ_SIZE        40
  361. #define        A_HSE_OBJ_SIZE        40
  362.  
  363. #define        OUT_OF_WNDWS        261
  364. #define        OUT_OF_MEM            262
  365.  
  366. /* Codes for object types */
  367.  
  368. #define        NO_OBJ                    0
  369. #define        ARROW_OBJ                1
  370. #define        CIRCLE_OBJ                2
  371. #define        SQUARE_OBJ                3
  372. #define        CUBE_OBJ                4
  373. #define        HOUSE_OBJ                5
  374. #define        PLOT_OBJ                6
  375. #define        BACKGRND_OBJ            7
  376. #define        ARMD_HOUSE3_OBJ            8
  377. #define        ARMD_HOUSE2_OBJ            9
  378. #define        ARMD_HOUSE1_OBJ            10
  379. #define        T_BACKGRND_OBJ            11
  380. #define        BARBIE                    12
  381. #define        KEN                        13
  382.  
  383. #define        MAX_OBJECTS            30
  384.  
  385. #define        X_ROTATION_BOX        1
  386. #define        Y_ROTATION_BOX        2
  387. #define        Z_ROTATION_BOX        3
  388. #define        NEG_X_ROT_BOX        4
  389. #define        NEG_Y_ROT_BOX        5
  390. #define        NEG_Z_ROT_BOX        6
  391. #define        X_ROT_TEXT_BOX        7
  392. #define        Y_ROT_TEXT_BOX        8
  393. #define        Z_ROT_TEXT_BOX        9
  394. #define        ROTATION_OK_BOX        10
  395. #define        ROT_CANCEL_BOX        11
  396. #define        DO_MANY_ROT_BOX        12
  397.  
  398. #define        DO_ROT_LEFT_BOX        13
  399. #define        DO_ROT_RT_BOX        14
  400. #define        DO_ROT_UP_BOX        15
  401. #define        DO_ROT_DN_BOX        16
  402. #define        DO_MOVE_IN_BOX        17
  403. #define        DO_MOVE_OUT_BOX        18
  404. #define        DO_PITCH_UP_BOX        19
  405. #define        DO_PITCH_DN_BOX        20
  406. #define        DO_YAW_LFT_BOX        21
  407. #define        DO_YAW_RT_BOX        22
  408. #define        DO_BANK_LFT_BOX        23
  409. #define        DO_BANK_RT_BOX        24
  410.  
  411. #define        X_STRETCH_BOX        1
  412. #define        Y_STRETCH_BOX        2
  413. #define        Z_STRETCH_BOX        3
  414. #define        NEG_X_STR_BOX        4
  415. #define        NEG_Y_STR_BOX        5
  416. #define        NEG_Z_STR_BOX        6
  417. #define        X_STR_TEXT_BOX        7
  418. #define        Y_STR_TEXT_BOX        8
  419. #define        Z_STR_TEXT_BOX        9
  420. #define        STRETCH_OK_BOX        10
  421. #define        STR_CANCEL_BOX        11
  422.  
  423. #define        NON_SELECTED        1
  424. #define        SELECTED            2
  425. #define        GROW_BOX            3
  426.  
  427. #define        DOC_LENGTH            700        /* 400 pixels in length */
  428. #define        DOC_WIDTH            720
  429.  
  430. #define        H_MIN_SIZE            50
  431. #define        V_MIN_SIZE            100
  432.  
  433.  
  434. EXTERN    Point                theNoColorPoint;
  435. EXTERN    Point                theTmNoColorPoint;
  436. EXTERN    RgnHandle        gray_rgn;
  437. EXTERN    PicHandle        gSkullPicture30;
  438. EXTERN    PicHandle        gSkullPicture35;
  439. EXTERN    PicHandle        gSkullPicture40;
  440. EXTERN    PicHandle        gSkullPicture45;
  441. EXTERN    PicHandle        gSkullPicture50;
  442. EXTERN    PicHandle        gSkullPicture55;
  443. EXTERN    PicHandle        gSkullPicture60;
  444. EXTERN    PicHandle        gSkullPicture65;
  445. EXTERN    PicHandle        gSkullPicture70;
  446. EXTERN    PicHandle        gSkullPicture75;
  447. EXTERN    PicHandle        gSkullPicture80;
  448. EXTERN    PicHandle        gSkullPicture85;
  449. EXTERN    PicHandle        gSkullPicture90;
  450. EXTERN    PicHandle        gSkullPicture95;
  451. EXTERN    PicHandle        gSkullPicture100;
  452. EXTERN    PicHandle        gCalcPicture;
  453. EXTERN    PicHandle        gIconizePicture;
  454. EXTERN    PicHandle        gColorPicture;
  455. EXTERN    PicHandle        gNewColorPicture;
  456. EXTERN    PicHandle        gNewCalcPicture;
  457. EXTERN    PicHandle        gUserPicture;
  458. EXTERN    PicHandle        gRADPicture;
  459. EXTERN    PicHandle        gGRADPicture;
  460. EXTERN    PicHandle        gPrgmPicture;
  461. EXTERN    PicHandle        gFPicture;
  462. EXTERN    PicHandle        gGPicture;
  463. EXTERN    PicHandle        gCPicture;
  464. //EXTERN    WindowPtr        gIconizeWindow;
  465. //EXTERN    WindowPtr        gCalcWindow;
  466. //EXTERN    WindowPtr        gNewCalcWindow;
  467. EXTERN    WindowPtr        gGraphicsWindow;
  468. EXTERN    WindowPtr        gMatAWindow;
  469. EXTERN    WindowPtr        gMatBWindow;
  470. EXTERN    WindowPtr        gMatCWindow;
  471. EXTERN    WindowPtr        gMatDWindow;
  472. EXTERN    WindowPtr        gMatEWindow;
  473. EXTERN    WindowPtr        gSRegWindow;
  474. EXTERN    WindowPtr        gProgWindow;
  475. EXTERN    WindowPtr        gRotateBox;
  476. EXTERN    WindowPtr        gStretchBox;
  477. EXTERN    ListHandle        matAList;
  478. EXTERN    ListHandle        matBList;
  479. EXTERN    ListHandle        matCList;
  480. EXTERN    ListHandle        matDList;
  481. EXTERN    ListHandle        matEList;
  482. EXTERN    ListHandle        SRegListn1;
  483. EXTERN    ListHandle        SRegListd1;
  484. EXTERN    ListHandle        SRegListn2;
  485. EXTERN    ListHandle        SRegListd2;
  486. EXTERN    ListHandle        SRegListn3;
  487. EXTERN    ListHandle        SRegListd3;
  488. EXTERN    ListHandle        SRegListn4;
  489. EXTERN    ListHandle        SRegListd4;
  490. EXTERN    ListHandle        progList;
  491. EXTERN    Boolean                gDone, gWNEImplemented, gHasPoint;
  492. EXTERN    EventRecord        gTheEvent;
  493. /*EXTERN    MenuHandle        gAppleMenu, gFileMenu, gWindowMenu, gProgMenu, gGraphMenu,gDorkMenu;*/
  494. EXTERN    short                    gCurRow, gMaxRow;
  495. EXTERN    short                    gFormatFlag;
  496. EXTERN    Rect                    gDragRect,gNoColorDragRect,gSizeRect;
  497. EXTERN    Rect                    gFRect,gNFRect,gGRect,gNGRect,gPrgmRect,gNPrgmRect;
  498. EXTERN    Rect                    gUserRect,gNUserRect;
  499. EXTERN    Rect                    gRADRect,gNRADRect;
  500. EXTERN    Rect                    gGRADRect,gNGRADRect;
  501. EXTERN    Rect                    gCRect,gNCRect;
  502.  
  503. EXTERN    char            gDisplayString[12];
  504. //EXTERN    char            gDisplayString[];
  505. EXTERN    char            *endptr;
  506. EXTERN    char            gResultString[11];
  507. EXTERN    char            gIndexString[3];
  508. EXTERN    char            gMemDisplayString[11];
  509. EXTERN    char            gMatrixElement[8];
  510. EXTERN    char            gMatrixString[11];
  511. EXTERN    char            gErrorString[11];
  512. EXTERN    char            gNullStr[11];
  513.  
  514. EXTERN    short            gStrCnt;
  515. EXTERN    double            gNum[10];
  516. EXTERN    unsigned long    qRan;
  517. //EXTERN    extended        rRan;
  518. //EXTERN    extended        qTemp,sTemp;
  519. EXTERN    double            M,N,P;
  520.  
  521. /*EXTERN    short            gResultMatrix;*/
  522.  
  523. EXTERN    Rect            gBlankRect;        /* Rect Data Type: IM: I-141    */
  524. EXTERN    Rect            gNBlankRect;
  525. EXTERN    decform            gF;
  526. EXTERN    Rect            gDisplayRect,gHPRect,g1499Rect,gTestRect;
  527. EXTERN    Rect            gSkullRect30,gSkullRect35,gSkullRect40,gSkullRect45,gSkullRect50;
  528. EXTERN    Rect            gSkullRect55,gSkullRect60,gSkullRect65,gSkullRect70,gSkullRect75;
  529. EXTERN    Rect            gSkullRect80,gSkullRect85,gSkullRect90,gSkullRect95,gSkullRect100;
  530. EXTERN    Rect            gZeroRect,gOneRect,gTwoRect,gThreeRect,gFourRect,gFiveRect;
  531. EXTERN    Rect            gSixRect,gSevenRect,gEightRect,gNineRect;
  532. EXTERN    Rect            gPointRect,gPlusRect,gMinusRect,gTimesRect,gDivideRect;
  533. EXTERN    Rect            gEnterRect,gSumRect,gChsRect,gEexRect,gInversRect;
  534. EXTERN    Rect            gTanRect,gEraseRect,gRclRect,gYtoXRect,gCosRect;
  535. EXTERN    Rect            gExchXYRect,gStoRect,g10toXRect,gSinRect,gRollDnRect;
  536. EXTERN    Rect            gGfxnRect,gFfxnRect,gEtoXRect,gGtoRect,gGsbRect;
  537. EXTERN    Rect            gSqrtRect,gSstRect,gRunStopRect,gOnRect;
  538.  
  539. EXTERN    Rect            gNDisplayRect,gNHPRect;
  540. EXTERN    Rect            gNZeroRect,gNOneRect,gNTwoRect,gNThreeRect,gNFourRect,gNFiveRect;
  541. EXTERN    Rect            gNSixRect,gNSevenRect,gNEightRect,gNNineRect;
  542. EXTERN    Rect            gNPointRect,gNPlusRect,gNMinusRect,gNTimesRect,gNDivideRect;
  543. EXTERN    Rect            gNEnterRect,gNSumRect,gNChsRect,gNEexRect,gNInversRect;
  544. EXTERN    Rect            gNTanRect,gNEraseRect,gNRclRect,gNYtoXRect,gNCosRect;
  545. EXTERN    Rect            gNExchXYRect,gNStoRect,gN10toXRect,gNSinRect,gNRollDnRect;
  546. EXTERN    Rect            gNGfxnRect,gNFfxnRect,gNEtoXRect,gNGtoRect,gNGsbRect;
  547. EXTERN    Rect            gNSqrtRect,gNSstRect,gNRunStopRect,gNOnRect;
  548.  
  549. EXTERN    Rect            hDisplayRect,hHPRect,hfZeroRect,hZeroRect,hgZeroRect;
  550. EXTERN    Rect            hfOneRect,hOneRect,hgOneRect,hfTwoRect,hTwoRect,hgTwoRect;
  551. EXTERN    Rect            hfThreeRect,hThreeRect,hgThreeRect,hfFourRect,hFourRect,hgFourRect;
  552. EXTERN    Rect            hfFiveRect,hFiveRect,hgFiveRect,hfSixRect,hSixRect,hgSixRect;
  553. EXTERN    Rect            hfSevenRect,hSevenRect,hgSevenRect,hfEightRect,hEightRect,hgEightRect;
  554. EXTERN    Rect            hfNineRect,hNineRect,hgNineRect,hfPointRect,hPointRect,hgPointRect;
  555. EXTERN    Rect            hfPlusRect,hPlusRect,hgPlusRect,hfMinusRect,hMinusRect,hgMinusRect;
  556. EXTERN    Rect            hfTimesRect,hTimesRect,hgTimesRect,hfDivideRect,hDivideRect,hgDivideRect;
  557. EXTERN    Rect            hfEnterRect,hEnterRect,hgEnterRect,hfSumRect,hSumRect,hgSumRect;
  558. EXTERN    Rect            hfChsRect,hChsRect,hgChsRect,hfEexRect,hEexRect,hgEexRect;
  559. EXTERN    Rect            hfInversRect,hInversRect,hgInversRect,hfTanRect,hTanRect,hgTanRect;
  560. EXTERN    Rect            hfEraseRect,hEraseRect,hgEraseRect,hfRclRect,hRclRect,hgRclRect;
  561. EXTERN    Rect            hfYtoXRect,hYtoXRect,hgYtoXRect,hfCosRect,hCosRect,hgCosRect;
  562. EXTERN    Rect            hfExchXYRect,hExchXYRect,hgExchXYRect,hfStoRect,hStoRect,hgStoRect;
  563. EXTERN    Rect            hf10toXRect,h10toXRect,hg10toXRect,hfSinRect,hSinRect,hgSinRect;
  564. EXTERN    Rect            hfRollDnRect,hRollDnRect,hgRollDnRect,hOnRect,hGfxnRect,hFfxnRect;
  565. EXTERN    Rect            hfEtoXRect,hEtoXRect,hgEtoXRect,hfGtoRect,hGtoRect,hgGtoRect;
  566. EXTERN    Rect            hfGsbRect,hGsbRect,hgGsbRect,hfSqrtRect,hSqrtRect,hgSqrtRect;
  567. EXTERN    Rect            hfSstRect,hSstRect,hgSstRect,hfRunStopRect,hRunStopRect,hgRunStopRect;
  568. EXTERN    Rect            hFRect,hGRect,hPrgmRect,hCRect,hUserRect,hRADRect,hGRADRect;
  569.  
  570. EXTERN    Rect            gHelpNot1_01,gHelpNot1_02,gHelpNot1_03,gHelpNot1_04,gHelpNot1_05;
  571. EXTERN    Rect            gHelpNot1_06,gHelpNot1_07,gHelpNot1_08,gHelpNot1_09,gHelpNot1_10;
  572. EXTERN    Rect            gHelpNot1_11,gHelpNot1_12,gHelpNot1_13,gHelpNot1_14,gHelpNot1_15;
  573. EXTERN    Rect            gHelpNot1_16,gHelpNot1_17,gHelpNot1_18,gHelpNot1_19,gHelpNot1_20;
  574. EXTERN    Rect            gHelpNot1_21,gHelpNot1_22,gHelpNot1_23,gHelpNot1_24,gHelpNot1_25;
  575. EXTERN    Rect            gHelpNot1_26,gHelpNot1_27,gHelpNot1_28,gHelpNot1_29,gHelpNot1_30;
  576. EXTERN    Rect            gHelpNot1_31,gHelpNot1_32,gHelpNot1_33,gHelpNot1_34,gHelpNot1_35;
  577. EXTERN    Rect            gHelpNot1_36;
  578.  
  579. EXTERN    Rect            gHelpNot2_01,gHelpNot2_02,gHelpNot2_03,gHelpNot2_04,gHelpNot2_05;
  580. EXTERN    Rect            gHelpNot2_06,gHelpNot2_07,gHelpNot2_08,gHelpNot2_09,gHelpNot2_10;
  581. EXTERN    Rect            gHelpNot2_11,gHelpNot2_12,gHelpNot2_13,gHelpNot2_14,gHelpNot2_15;
  582. EXTERN    Rect            gHelpNot2_16,gHelpNot2_17,gHelpNot2_18,gHelpNot2_19,gHelpNot2_20;
  583. EXTERN    Rect            gHelpNot2_21,gHelpNot2_22,gHelpNot2_23,gHelpNot2_24,gHelpNot2_25;
  584. EXTERN    Rect            gHelpNot2_26,gHelpNot2_27,gHelpNot2_28,gHelpNot2_29,gHelpNot2_30;
  585. EXTERN    Rect            gHelpNot2_31,gHelpNot2_32,gHelpNot2_33,gHelpNot2_34,gHelpNot2_35;
  586. EXTERN    Rect            gHelpNot2_36;
  587.  
  588.  
  589. /*    struct defs    */
  590.  
  591.  
  592.             
  593. typedef struct
  594. {
  595.     Str255            Field4Text;
  596.     Str255            Field6Text;
  597.     Str255            Field8Text;
  598.     
  599. } ShareRec, *ShareRecPtr;
  600.  
  601.  
  602. struct    _3dPtStrk
  603. {
  604.     long    x_point;
  605.     long    y_point;
  606.     long    z_point;
  607.     long    no_point;
  608. };
  609. EXTERN struct _3dPtStrk    _3dPt[18], _3dPtH[18];
  610. /****************************************************/
  611. struct    _3dPtStrk_BG
  612. {
  613.     long    x_point;
  614.     long    y_point;
  615.     long    z_point;
  616.     long    no_point;
  617. };
  618. EXTERN struct _3dPtStrk_BG    _3dPt_BG[70], _3dPtH_BG[70], gXYZplane;
  619. /****************************************************/
  620. struct    vRvector
  621. {
  622.     double    vectElem[4];
  623. };
  624. EXTERN struct vRvector;
  625. /****************************************************/
  626. struct rotstruk
  627. {
  628.     double    rotElem;
  629. };
  630. EXTERN struct rotstruk    rotHist[4][4];
  631. /****************************************************/
  632. struct    msStruct
  633. {
  634.     Rect    mRect;
  635. };
  636. EXTERN struct msStruct mStruct[14];
  637. /****************************************************/
  638. struct    sndStruct
  639. {
  640.     SndChannelPtr    Chan00;
  641. };
  642. EXTERN struct sndStruct sndStruct[10];
  643. /****************************************************/
  644. typedef    struct
  645. {
  646.     Rect            bounds;                    /* obj_rect    */
  647.     short            type;                    /* objType    */
  648.     short            missles;
  649.     Boolean            selected;
  650.     Boolean            armed;
  651.     struct            _3dPtStrk    _3dPtH[22];    /* creation coordinates */
  652.     struct            _3dPtStrk    _3dPt[22];
  653.     struct            rotstruk    rotHist[4][4];
  654.     struct            msStruct    mStruct[14];
  655.     struct            sndStruct     sndStruct[10];
  656.     PolyHandle        thePoly[6];
  657.     PixPatHandle    thePPat[6];
  658. } objectDescr;
  659. /****************************************************/
  660. typedef    struct
  661. {
  662.     Rect            bounds;                    /* obj_rect    */
  663.     short            type;                    /* objType    */
  664.     Boolean            selected;
  665.     Boolean            hasTargets;
  666.     Boolean            alive;
  667.     struct            _3dPtStrk_BG    _3dPtH_BG[8];    /* creation coordinates */
  668.     struct            _3dPtStrk_BG    _3dPt_BG[8];    
  669.     struct            rotstruk    rotHist[4][4];
  670.     long            z_reg;
  671.     short            max_pts;
  672.     PolyHandle        thePoly[6];
  673.     PixPatHandle    thePPat[6];
  674. } objectDescr_BG;
  675. /****************************************************/
  676. typedef    struct        /** contains info needed to specify each window's contents **/
  677. {
  678.     THPrint            prInfoHndl;
  679.     Boolean            dirty;
  680.     Boolean            hasRealName;
  681.     Boolean            hasBackGround;
  682.     Boolean            isArmed;
  683.     short            targets_left;
  684.     short            armament_type;    /* 0 = guns, 1 = guns & missles, 2 = guns, missles & neutron bomb    */
  685.     short            arms_selected;    /* 0 = guns, 1 = missles, 2 = neutron bomb    */
  686.     Boolean            hasTargets;
  687.     SFReply            findFile;
  688.     Point            scrollAmount;
  689.     ControlHandle    myVCntrlHdl;        /* verticle scroll bar */
  690.     ControlHandle    myHCntrlHdl;        /* horizontal scroll bar */
  691.     short            vDocLimit;
  692.     short            hDocLimit;
  693.     TPrint            printInfo;
  694.     short            paletteSetting;
  695.     short            vPtNo;
  696.     long            focalLn;
  697.     long            xvPt;
  698.     long            yvPt;
  699.     short            focalPtNo;
  700.     short            isPrey;
  701.     struct            _3dPtStrk_BG    gXYZplane;
  702.     objectDescr_BG    bg_object[22];            /*    22 is OK    */
  703.     objectDescr        object[MAX_OBJECTS];    /* objDescr */    /*    MAX_OBJECTS happens to be 30 */
  704. } WObjs, **WObjsHandle;
  705. /****************************************************/
  706. typedef    struct        /** contains info needed to specify prog window's contents **/
  707. {
  708.     THPrint            prInfoHndl;
  709.     Boolean            dirty;
  710.     Boolean            hasRealName;
  711.     SFReply            findFile;
  712.     Point            scrollAmount;
  713.     ControlHandle    myVCntrlHdl;        /* verticle scroll bar */
  714.     short            vDocLimit;
  715.     short            hDocLimit;
  716.     TPrint            printInfo;
  717. } WPObjs, **WPObjsHandle;
  718. /****************************************************/
  719. typedef    struct        /** contains info needed to specify each str box window's contents **/
  720. {
  721.     Boolean            dirty;
  722.     Boolean            hasRealName;
  723.     double            xDir;
  724.     double            yDir;
  725.     double            zDir;
  726.     short            paletteSetting;
  727. } WSObjs, **WSObjsHandle;
  728. /****************************************************/
  729. typedef    struct        /** contains info needed to specify each  rot box window's contents **/
  730. {
  731.     Boolean            dirty;
  732.     double            xAngle;
  733.     double            yAngle;
  734.     double            zAngle;
  735.     short            paletteSetting;
  736. } WRObjs, **WRObjsHandle;
  737. /****************************************************/
  738. typedef    struct        /**    used to calculate the size of    **/
  739.                     /**    the data written to a file        **/
  740. {
  741.     short            vDocLimit;
  742.     short            hDocLimit;
  743.     TPrint            printInfo;
  744.     short            paletteSetting;
  745.     objectDescr        fileDataObject[MAX_OBJECTS];    /* objDescr */
  746. } fileDataRecord, *fileDataPtr;
  747. /****************************************************/
  748.  
  749. typedef    struct
  750. {
  751.     objectDescr        object[1];
  752.     short            type;
  753.     Boolean            hasBackGround;
  754.     Boolean            isArmed;
  755.     short            targets_left;
  756.     short            armament_type;    /* 0 = guns, 1 = guns & missles, 2 = guns, missles & neutron bomb    */
  757.     short            arms_selected;    /* 0 = guns, 1 = missles, 2 = neutron bomb    */
  758.     Boolean            hasTargets;
  759.  
  760. }    pred_data, prey_data, **PredDataHndl, **PreyDataHndl;
  761. /****************************************************/
  762.  
  763.  
  764. extern    struct    wTblStruct                        /* space for some window info        */
  765.         {    
  766.             WindowPtr        windPtr;            /* pointer to window record            */
  767.             WindowRecord    windRec;            /* window record                    */
  768.             TEHandle        windTEH[windTEHMax];    /* handles for TE items            */
  769.             short            windTEHCount;            /* how many handles are in use    */
  770.             short            windTEHSub;                /* subscript for active TE item    */
  771.             ControlHandle    windCntlH[windCntlHMax];    /* handles to controls        */
  772.             short            windCntlHSub;            /* subscript for active control    */
  773.             short            windCntlHCount;            /* how many controls are in use    */
  774.             SFReply            windReply;            /* SF Reply associated with window    */
  775.             short            windPathRefNum;        /* Path reference number from open    */
  776.             Boolean            windTEChanged;        /* Data changed since previous save    */
  777.         }
  778.         windTbl[windMax];                        /* table of many of the above        */
  779. extern    short                windSub;            /* subscript for window table        */
  780.  
  781. /*****************************************************************/
  782. /*  P R O T O T Y P E S
  783. /*****************************************************************/
  784.  
  785.  
  786.  
  787.         short        one_of_mine            (WindowPtr wPtr);
  788.         void        DeParse                (void);
  789.         void        ClearFlags            (void);
  790.         void        HandleButtonReg        (
  791.                                             struct regstrk    *whichRegn,
  792.                                             struct regstrk    *whichReg0n
  793.                                         );
  794.         void        ParseString            (void);
  795.         void        cat_strings            (
  796.                                             char *str1, char *str2,
  797.                                             unsigned long dest_max
  798.                                         );
  799.         void        clip_4_palette        (WindowPtr wPtr);
  800.         void        inval_object        (WindowPtr wPtr, short index);
  801.         void        died (char desc[255], int code, int ref);
  802.  
  803. #endif    /*    __C14__    */